Repository navigation
feat(taxonomy): add publish, localize and unlocalize - #203
reeshika-h wants to merge 2 commits into
Conversation
publish starts a publish job for one or more taxonomies and is collection-level, so it is rejected on a taxonomy bound to a uid. The API only reports that the request was accepted, so the docstring points at the publish queue for the outcome. localize and unlocalize are instance-level. Both require a non-blank locale; unlocalize in particular must not be callable without one, because a DELETE with no locale removes the whole taxonomy. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
Problem
The Python management SDK has no call for the "Publish taxonomies" API
(
POST /v3/taxonomies/publish) and none for localizing or unlocalizing ataxonomy. The only way to remove a taxonomy's localized version was a raw
DELETE taxonomies/{uid}?locale=…, and the samedelete()with the localemissing deletes the whole taxonomy, so a missing argument could silently
destroy data.
Ticket: https://contentstack.atlassian.net/browse/DX-10478
Fix
Taxonomy.publish(data)posts the body as given totaxonomies/publish(flat
{locales, environments, items: [{uid}]}, noapi_versionorscheduled_at, no client-side validation). It is collection-level, so ataxonomy bound to a uid is rejected with the new
TAXONOMY_UID_NOT_ALLOWED.A
branchheader goes through the existingadd_header.accepted, not published, and points at
stack.publish_queue().find()andthe publish-failure webhooks for the outcome.
Taxonomy.localize(data, locale)posts totaxonomies/{uid}?locale=…;Taxonomy.unlocalize(locale)sends theDELETEand returns the rawresponse (204, empty body). Both require a uid and a non-blank locale and
raise
ArgumentExceptionbefore any request is sent, sounlocalizecannever turn into a whole-taxonomy delete. The locale is required, unlike
Entry.localize, which defaults toen-us: a default would silentlytarget the master locale on a destructive call.
validate_taxonomy_uid, are untouched.add_headerwrites to the client-wideclient.client.headers, so abranchheader persists across calls (thepublishdocstring says so); the uid is interpolated into the URL pathunescaped, as in
fetch,updateanddelete.live-stack tests in
tests/api/taxonomies(publish ×3, localize,unlocalize). The live-stack tests have not been run yet: they need a stack
with environments, locales and a
mainbranch, and the unit tier logs inlive, so it can time out on a slow network. Snyk did not run locally; CI's
scan covers it.